package com.jrx.anytxn.transaction.dto.loan;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.jrx.anytxn.transaction.dto.common.CommonReq;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.*;
import java.math.BigDecimal;

/**
 * @author xqy
 * @version 1.0
 * @date 2020/8/3
 */
public class MatchingAmortMethodReq  extends CommonReq {

    @ApiModelProperty(value = "产品编号")
    @NotEmpty(message = "产品编号不允许空")
    private String productId;

    @ApiModelProperty(value = "贷款金额",required = true)
    @NotNull
    @Digits(integer=18, fraction=2,message="贷款金额最多俩位小数且长度不得大于18")
    @DecimalMin(value="0",message="贷款金额必需大于0")
    @JsonSerialize
    private BigDecimal loanAmount;


    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public BigDecimal getLoanAmount() {
        return loanAmount;
    }

    public void setLoanAmount(BigDecimal loanAmount) {
        this.loanAmount = loanAmount;
    }

    @Override
    public String toString() {
        return "MatchingAmortMethodReq{" + "productId='" + productId + '\'' + ", loanAmount=" + loanAmount + '}';
    }
}